import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:furaha_mkopo/commonTool/fm_language_tool.dart';

import '../commonTool/fm_screen_tool.dart';
import '../commonUI/fm_bottom_button.dart';

class FMWelcomeCell extends StatelessWidget {

  final String imageName;

  final bool isLast;

  final GestureTapCallback? onTap;

  const FMWelcomeCell({super.key,required this.imageName,required this.isLast,this.onTap});

  @override
  Widget build(BuildContext context) {
      return Stack(
        children: [
          _imageWidget(context),
          _bottomWidget(context)
        ],
      );
  }

  Widget _imageWidget(BuildContext context) {
    return Positioned(
      top: 0,
      left: 0,
      right: 0,
      bottom: 0,
      child: Image.asset(FMLanguageTool.getAssets("assets/welcome/$imageName",suffix: ".webp"),fit:BoxFit.cover)
    );
  }

  Widget _bottomWidget(BuildContext context) {
    return Positioned(
        left: 38,
        right: 38,
        bottom: 62 + FMScreenTool.bottomPadding(context),
        child: FMBottomButton(
          title:isLast ? FMLanguageTool.getText("Start Now") : FMLanguageTool.getText("Next"),
          onTap: onTap,
        )
    );
  }
}
